﻿using ERP.Workflow.Designer.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using ERP.Workflow.Designer.Domain.IRepository;
using System.ComponentModel.Design;

namespace ERP.Workflow.Designer.EntityFrameworkCore.Repositorys
{
    //public static class FF
    //{
    //    public static IQueryable<Definition> IncludeDetails(this IQueryable<Definition> queryable, bool include = true)
    //    {
    //        if (!include)
    //        {
    //            return queryable;
    //        }

    //        return queryable
    //            .Include(m => m.Nodes).ThenInclude(m => m.Ports)
    //            .Include($"{nameof(Link)}.{nameof(Link.Labels)}")
    //            .Include($"{nameof(Link)}.{nameof(Link.Vertices)}")
    //            .Include($"{nameof(Link)}.{nameof(Link.TargetNode)}")
    //            .Include($"{nameof(Link)}.{nameof(Link.SourceNode)}")
    //            .Include($"{nameof(Link)}.{nameof(Link.SourcePort)}")
    //            .Include($"{nameof(Link)}.{nameof(Link.TargetPort)}")



    //            ;

    //    }
    //}
    public class DefinitionRepository : EfCoreRepository<IWorkflowDesignerDbContext, Definition, Guid>
        , IEfCoreRepository<Definition>,
        IDefinitionRepository
    {
        public DefinitionRepository(IDbContextProvider<IWorkflowDesignerDbContext> dbContextProvider) : base(dbContextProvider)
        {
        }

        public override async Task<IQueryable<Definition>> GetQueryableAsync()
        {

            return await base.GetQueryableAsync();
        }
    }

















}
